/*
 * @Author: 徐建辰
 * @Date: 2021-11-04 14:33:01
 * @LastEditTime: 2021-11-04 14:36:15
 * @LastEditors: Please set LastEditors
 * @Description: 搜索建议组件
 */
import React, {memo} from 'react'
import PropTypes from 'prop-types'
import './CitySelector.css'

const SearchItem = memo(function SearchItem(props) {
  const {name, onClickCity} = props
  return (
    <li className="city-suggest-li" onClick={() => onClickCity(name)}>{name}</li>
  )
})

SearchItem.propTypes = {
  name: PropTypes.string.isRequired,
  onClickCity: PropTypes.func.isRequired,
}

export default SearchItem
